﻿@{
    ViewBag.Title = "Home Page";
}
<link href="~/Content/css/video-js.min.css" rel="stylesheet">
<script src="~/Content/js/video.min.js"></script>
<script>
    <!--支持播放flv -->
    videojs.options.flash.swf = "video-js.swf";
</script>
<div class="jumbotron">
    <h1>ASP.NET</h1>
    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
    <p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>

<div class="row">
    <video id="myVideo" class="video-js vjs-default-skin" style="margin:0 auto" controls preload="none" width="640" height="400"
           poster="http://video-js.zencoder.com/oceans-clip.png"
           data-setup="{}" autoplay="autoplay">
        <source id="mySource" />
    </video>
    <script>
        function GetRequest() {
            var url = location.search;
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for (var i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }
        function InitiliazeVideo() {
            var Request = GetRequest();
            var src = document.getElementById("mySource");
            var name = Request["name"];
            src.src = "vedios/" + name;
            var arr = name.split('.');
            arr = arr[arr.length - 1];
            src.type = "video/wmv";
            var myPlayer = videojs('myVideo');
            myPlayer.requestFullscreen();
        }
        InitiliazeVideo();

    </script>
</div>